package cn.yzfy.common.base.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 基础输出对象带id和时间字段
 */
@NoArgsConstructor
@Getter public class BaseIdAndTimeVO extends BaseOutputVO {
  
  @Serial
  private static final long serialVersionUID = -8243192684166209735L;
  
  public BaseIdAndTimeVO(LocalDateTime createdTime, LocalDateTime updatedTime) {
    this.createdTime = createdTime;
    this.updatedTime = updatedTime;
  }
  
  public BaseIdAndTimeVO(Long id, LocalDateTime createdTime, LocalDateTime updatedTime) {
    super(id);
    this.createdTime = createdTime;
    this.updatedTime = updatedTime;
  }
  
  /**
   * 创建时间
   */
  @Setter
  @Schema(description = "创建时间", name = "createdTime", example = "2024-07-12 10:11:55")
  private LocalDateTime createdTime;
  
  /**
   * 更新时间
   */
  @Setter
  @Schema(description = "更新时间", name = "updatedTime", example = "2024-07-12 10:11:55")
  private LocalDateTime updatedTime;
  
  // public void setCreatedTime(LocalDateTime createdTime) {
  //   this.createdTime = createdTime;
  // }
  
  // public void setUpdatedTime(LocalDateTime updatedTime) {
  //   this.updatedTime = updatedTime;
  // }
}